#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

char Initboard(char area[3][3])
{
    int i = 0, j = 0, k = 0;
    for (i = 0; i < 3; i++) {
        for (j = 0; j < 2; j++) {
            if (area[i][j] == area[i][j + 1]) {
                k++;
            }
        }
        if (k == 2) {
            return area[i][j];
        }
        k = 0;
    }
    for (i = 0; i < 3; i++) {
        for (j = 0; j < 2; j++) {
            if (area[j][i] == area[j + 1][i]) {
                k++;
            }
        }
        if (k == 2) {
            return area[j][i];
        }
        k = 0;
    }
    for (i = 0; i < 2; i++) {
        if (area[i][i] == area[i + 1][i + 1]) {
            k++;
        }
    }
    if (k == 2) {
        return area[i - 1][i - 1];
    }
    k = 0;
    for (i = 0; i < 2; i++) {
        j = 2 - i;
        if (area[i][j] == area[i + 1][j - 1]) {
            k++;
        }
    }
    if (k == 2) {
        return area[i - 1][j];
    }
    return 'N';
}

int main() {
    char board[3][3] = { 0 };
    int i = 0, j = 0;
    for (i = 0; i < 3; i++) {
        for (j = 0; j < 3; j++) {
            scanf(" %c", &board[i][j]);
        }
    }
    char a = Initboard(board);
    if (a == 'K') {
        printf("KiKi wins!\n");
    }
    else if (a == 'B') {
        printf("BoBo wins!\n");
    }
    else {
        printf("No winner!\n");
    }
    return 0;
}